package version3.part1.Client.serviceCenter.balance.impl;

import version3.part1.Client.serviceCenter.balance.LoadBalance;

import java.util.List;

public class RoundLoadBalance implements LoadBalance {
    private static int choose = -1;
    @Override
    public String balance(List<String> addressList) {
        choose++;
        choose = choose%addressList.size();
        System.out.println("负载均衡选择了"+choose+"号服务器");
        return addressList.get(choose);
    }

    @Override
    public void addAddress(String address) {

    }

    @Override
    public void removeAddress(String address) {

    }
}
